package com.learn.example.orderservice.controller;

import com.learn.example.orderservice.model.OrderInfo;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @description:
 * @author: lfc
 * @version: 2020/5/21 11:01
 */
@RestController
@RequestMapping("/order")
public class OrderController {

    @GetMapping("/{userid}/info")
    private OrderInfo getOrderInfoByUser(@PathVariable("userid") String userId){
      OrderInfo orderInfo = new OrderInfo();

      orderInfo.setCommodityId("jd001");
      orderInfo.setOrderDesc(userId + "的家电消费订单");
      orderInfo.setUserId(userId);
      orderInfo.setOrderId("order001");

      return orderInfo;
    }
}
